package com.estate.system.domain.report.saledepartmentmanager.listinganalysis;

import java.util.Objects;

public class ComparisonAnalysis {
    private Integer sold;
    private Integer inventory;
    private Integer newData; // 避免使用关键字"new"
    
    public ComparisonAnalysis() {}
    
    public ComparisonAnalysis(Integer sold, Integer inventory, Integer newData) {
        this.sold = sold;
        this.inventory = inventory;
        this.newData = newData;
    }
    
    // Getter和Setter方法
    public Integer getSold() { return sold; }
    public void setSold(Integer sold) { this.sold = sold; }
    
    public Integer getInventory() { return inventory; }
    public void setInventory(Integer inventory) { this.inventory = inventory; }
    
    public Integer getNewData() { return newData; }
    public void setNewData(Integer newData) { this.newData = newData; }
    
    @Override
    public String toString() {
        return String.format("Sold: %d, Inventory: %d, New: %d", sold, inventory, newData);
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ComparisonAnalysis dailyData = (ComparisonAnalysis) o;
        return Objects.equals(sold, dailyData.sold) &&
               Objects.equals(inventory, dailyData.inventory) &&
               Objects.equals(newData, dailyData.newData);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(sold, inventory, newData);
    }
}